<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <link href="/Show/Admin/Public/css/news.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="/Show/Admin/Public/js/jquery-3.1.1.min.js"></script>
    {literal}
    <script type="text/javascript">
     $(document).ready(function(){
            $("input").change(function(){
                var id   = $(this).attr('fd');
                var sort = $(this).val();
                $.post('change',{id:id,sort:sort},function(data){
                    if(data){
                        alert(data);
                    }
                });
            });
        });
    </script>
    {/literal}
    <title>链接管理</title>
  </head>
  <body>
    <div class="mainbox">
          <div class="tablebox">            
            <table class="table" >
              <tr class="one">
                <td>ID</td>
                <td>链接名称</td>
                <td>链接地址</td>
                <td>排序</td>
                <td>操作</td> 
              </tr>
               {section name=f loop=$flist}
              <tr>
                  <td colspan="8"><strong>{$flist[f].link_class_name}</strong></td>
              </tr>  
                {section name=n loop=$list}
                {if $list[n].link_f_id==$flist[f].link_class_id}
                <tr>
                  <td>{$list[n].link_id}</td>               
                  <td>{$list[n].link_name}</td>                            
                  <td><a href="{$list[n].link_address}" target="_blank">{$list[n].link_address}</a></td>               
                  <td><input type="text" fd="{$list[n].link_id}" value="{$list[n].link_sort}"></td>           
                  <td>
                      <a href="#" onclick="if(confirm('确定删除？'))location.href='{$smarty.const.__CONTROLLER__}/delete/link_id/{$list[n].link_id}';"><img src="/Show/Admin/Public/image/del.jpg" class="pit" title="删除"></a>
                      <a href="#" onclick="location.href='{$smarty.const.__CONTROLLER__}/xiugai/link_id/{$list[n].link_id}'" ><img src="/Show/Admin/Public/image/edi.jpg" class="pit" title="编辑"></a>     
                  </td>
                </tr>
                {/if}
                {/section}
              {/section}
            </table>          
          </div>
    </div>
  </body>
</html>